package org.tinaelle.client.gui;

import org.tinaelle.client.utils.ScreenManager;
import org.tinaelle.client.utils.TinaelCenterPanel;

import com.gwtext.client.core.EventObject;
import com.gwtext.client.widgets.Button;
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
import com.gwtext.client.widgets.form.FieldSet;

public class AdminPanel extends TinaelCenterPanel {

	@Override
	public Panel getViewPanel() {
		if ( panel == null ) {
			panel = new Panel();

			final FieldSet treeFieldSet = new FieldSet( "Trees" );
			final Button resetMenuTree = new Button( "Reset Menu", new ButtonListenerAdapter() {
				@Override
				public void onClick(final Button button, final EventObject e) {
					ScreenManager.getInstance().rebuildAccordionNav();
				}
			} );
			treeFieldSet.addButton( resetMenuTree );

			panel.add( treeFieldSet );
		}
		return panel;
	}

}
